<template>
  <div>
    <button @click="handClick">点击登录</button>
  </div>
</template>
<!-- 
<script>
import { SET_TOKEN } from '@/utils/token'
export default {
  name: 'Login',
  methods: {
    handClick() {
      SET_TOKEN('123')
      this.$router.push('/')
    }
  }
}
</script> -->
<script setup>
import { SET_TOKEN } from '@/utils/token'
defineOptions({
  name: 'Login'
})
import { useRouter } from 'vue-router'
const router = useRouter()
const handClick = () => {
  SET_TOKEN('123')
  router.push('/')
}
</script>
